<html>
<head>
  <title>Hub - Subscription Details - {{topic_url|escape}}</title>
  <link rel="stylesheet" href="/base.css" type="text/css">
  <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="/favicon.ico">
</head>
<body>

<h1>Subscription Details - {{topic_url|escape}}</h1>

{% if error %}
<div>{{error|escape}}</div>
{% else %}
<table cellspacing="0", cellpadding="3" border="0">
  <tr>
    <td>Callback URL:</td>
    <td>{{callback_url|escape}}</td>
  </tr>
  <tr>
    <td>Created time (UTC):</td>
    <td>{{created_time|date:"Y-m-d\TH:i:s\Z"}}</td>
  </tr>
  <tr>
    <td>Last modified time (UTC):</td>
    <td>{{last_modified|date:"Y-m-d\TH:i:s\Z"}}</td>
  </tr>
  <tr>
    <td>Expiration time (UTC):</td>
    <td>{{expiration_time|date:"Y-m-d\TH:i:s\Z"}}</td>
  </tr>
  <tr>
    <td>State:</td>
    <td>{{subscription_state}}</td>
  </tr>
  <tr>
    <td>Confirmation failures:</td>
    <td>{{confirm_failures}}</td>
  </tr>
  <tr>
    <td>Delivery to domain:</td>
    <td>
      {% if delivery_blocked %}
        <span style="color: red">BLOCKED</span>
      {% else %}
        OK
      {% endif %}
    </td>
  </tr>
  <tr>
    <td>Delivery short-term:</td>
    <td>{{delivery_errors|floatformat:"-2"}}% errors</td>
  </tr>
</table>

<h2>Error rate statistics</h2>
{% for result in delivery_url_error %}
  {% include "stats_table.html" %}
{% endfor %}
{% for result in delivery_domain_error %}
  {% include "stats_table.html" %}
{% endfor %}

<h2>Latency statistics</h2>
{% for result in delivery_url_latency %}
  {% include "stats_table.html" %}
{% endfor %}
{% for result in delivery_domain_latency %}
  {% include "stats_table.html" %}
{% endfor %}

{% for event in failed_events %}
<hr size="1">
<h2>Failure {{forloop.counter}}</h2>
<p>
<table cellspacing="0", cellpadding="3" border="0">
  <tr>
    <td>Next/Last attempt time (UTC):</td>
    <td>{{event.last_modified|date:"Y-m-d\TH:i:s\Z"}}</td>
  </tr>
  <tr>
    <td>Totally failed:</td>
    <td>{{event.totally_failed}}</td>
  </tr>
  <tr>
    <td>Retry attempts:</td>
    <td>{{event.retry_attempts}}</td>
  </tr>
  <tr>
    <td>Content type:</td>
    <td>{{event.content_type|escape}}</td>
  </tr>
</table>

<p>Payload, possibly truncated:</p>
<pre>
{{event.payload_trunc|escape}}
</pre>
</p>
{% endfor %}

{% endif %}


</body>
</html>
